package adv6;

public class Thread3Worker extends Thread {
	public Thread3Worker(String n) {

		super(n);
	}

	@Override
	public void run() {
		while (true) {
			try {
				System.out.println(super.getName() + "睡500毫秒");
				sleep(500);
				System.out.println(super.getName() + "睡到自然醒，继续干活");

			} catch (InterruptedException e) {

				e.printStackTrace();
				System.out.println("工人" + super.getName() + "被地主打醒，起来干活");
			}
		}
	}
}
